﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Fiddler;

namespace BareWeb.HtmlExtension.Extensions
{
    public class HtmlInspectorExtension : IFiddlerExtension
    {
        private TabPage oPage;
        private HtmlInspectorControl oView;

        #region IFiddlerExtension Members

        public void OnBeforeUnload()
        {
            oPage.Dispose();
        }

        public void OnLoad()
        {
            FiddlerApplication.UI.tabsViews.ImageList.Images.Add("bareweb", Resource1.BWC); 
            this.oPage = new TabPage("HTML Inspector");
            this.oPage.ImageIndex = FiddlerApplication.UI.tabsViews.ImageList.Images.IndexOfKey("bareweb");
            
            this.oView = new HtmlInspectorControl();
            
            this.oPage.Controls.Add(this.oView);
            this.oPage.Dock = DockStyle.Fill;
            this.oView.Dock = DockStyle.Fill;
            FiddlerApplication.UI.tabsViews.TabPages.Add(this.oPage);
        }

        #endregion
    }
}
